<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>单行文本溢出替换省略号</title>
    <style>
        div {
            background-color: yellow;
            /*限制父元素的宽度,否则文字写不下会换行,不会溢出*/
            width: 200px;
            /*强制文本不换行*/
            white-space: nowrap;
            /*溢出隐藏 多余的文字直接裁掉*/
            overflow: hidden;
            /*溢出的文字替换为省略号*/
            text-overflow: ellipsis;
        }
    </style>
</head>
<body>
    <div>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsum, quo, saepe. Cum ea in numquam odio repudiandae! Aperiam, asperiores et ex in magni odit quibusdam repellat tempore temporibus ullam veniam.
    </div>
</body>
</html>